import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import Home from '../components/Home.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: { showTabBar: true }
  },
  {
    path: '/panel',
    name: 'Panel',
    component: () => import('../components/Panel.vue'), // Lazy-loaded
    meta: { showTabBar: false }
  },
  {
    path: '/post',
    name: 'Post',
    component: () => import('../components/Post.vue'), // Lazy-loaded
    meta: { showTabBar: false }
  },
  {
    path: '/chat',
    name: 'Chat',
    component: () => import('../components/Chat.vue'), // Lazy-loaded
    meta: { showTabBar: false }
  },
  {
    path: '/user',
    name: 'User',
    component: () => import('../components/User.vue'), // Lazy-loaded
    meta: { showTabBar: false }
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router